/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cw.biz;

import cw.controller.LevelJpaController;
import cw.entity.Level;
import java.util.List;

/**
 *
 * @author VinhTC
 */
public class LevelBiz {

    LevelJpaController levelController = new LevelJpaController();

    public LevelBiz() {
    }

    /**
     * getLevelByName
     * @param levelName
     * @return Level
     */
    public Level getLevelByName(String levelName) {
        try {
            return levelController.getLevelByName(levelName);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    /**
     * getLevelById
     * @param levelId
     * @return Level
     */
    public Level getLevelById(int levelId) {
        try {
            return levelController.findLevel(levelId);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    /**
     * this method use to get all Level from tblLevel
     * @return --List Level Object
     */
    public List<Level> getAllLevel() {

        try {    
            return levelController.findLevelEntities();
             
        } catch (Exception e) {
            return null;
        }
    }
}
